package com.yq.ylmall.model.product;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yq.ylmall.model.base.BaseEntity;
import com.yq.ylmall.vo.product.RegionVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 中国省市区
 * </p>
 *
 * @author lsx
 * @since 2024-06-11
 */
@Data
@TableName("region")
@ApiModel(value = "Region对象",description = "地区")
public class Region extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "地区编码")
    private Long code;

    @ApiModelProperty(value = "上级地区code")
    private Long parentCode;

    @ApiModelProperty(value = "地区名称")
    private String name;

    @ApiModelProperty(value = "地区级别：0-中国、1-省、自治区、直辖市 2-地级市、地区、自治州、盟 3-市辖区、县级市、县")
    private Integer level;

    //下级列表
    @TableField(exist = false)
    private List<RegionVo> children;

}
